<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<html>
<head>
    <script type="text/javascript" src="resource/js/jquery-3.2.1.js"></script>
    <script type="text/javascript" src="/resource/js/bootstrap.js"></script>
    <link rel="stylesheet" href="/resource/css/bootstrap.css">
    <link rel="stylesheet" href="resource/css/index3.css" type="text/css">
    <script type="text/javascript" src=resource/js/My97DatePicker/WdatePicker.js></script>
    <script type="text/javascript" src="/resource/js/DateUtil.js"></script>
    <title>注册</title>
</head>
<body>
<div class="container">
   <form action="${pageContext.request.contextPath}/register" method="post">
       <font size="30">注册</font><br>
       手机号:<input type="text" name="phone"><input type="button" value="获取验证码" onclick="getyzm()"><br>
       验证码:<input type="text" name="yzm"><br>
       密码:<input type="text" name="password"><br>
       重复密码:<input type="text" name="password1" onblur="pwd()"><br>
        <input type="submit" value="注册">
   </form>

</div>
</body>
<script>
    function getyzm(){
        var phone=$("[name='phone']").val();
        $.post(
            "getyzm",
            {phone:phone},
            function (msg){
            alert("验证码已经发送到控制台")
            }
        )
    }

    function pwd(){
        var password=$("[name='password']").val();
        var password1=$("[name='password1']").val();
        if(password!=password1){
            alert("两次密码不一样");
        }

    }
</script>
</html>